#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>

int main()
{
    close(1);
    int fd = open("log.txt",O_CREAT | O_WRONLY | O_APPEND,0666);

    printf("hello bit\n");
    printf("hello bit\n");
    printf("hello bit\n");

    const char *s = "write\n";
    write(fd,s,strlen(s));

    close(fd);

    return 0;
}
